package com.itlxd.service;

import com.itlxd.entity.ShoppingCart;
import com.itlxd.entity.ShoppingCart;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 购物车 服务类
 * </p>
 *
 * @author ${author}
 * @since 2021-12-25
 */
public interface IShoppingCartService {

    /**
     * 通过用户id获得购物车列表
     * @return
     */
    List<ShoppingCart> listShoppingCarts(Long userId);

    /**
     * 添加商品到购物车
     * @return
     */
    Integer insertShoppingCart(ShoppingCart food);

    /**
     * 从购物车中减少商品数量
     * @param food
     * @return
     */
    Integer updateShoppingCart(ShoppingCart food);

    /**
     * 通过用户id清空购物车
     * @param userId
     * @return
     */
    Integer deleteShoppingCart(Long userId);
}
